package arithmetic.socket.netty.serverClient;

import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * @author jiangfeng
 * Created on 2020-03-01
 */
public class TestServerHandler extends SimpleChannelInboundHandler<String> {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
        System.out.println(msg);
        Channel channel = ctx.channel();
        channel.writeAndFlush("[服务器]"+channel.remoteAddress());
    }
}
